import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import {
  Pagination,
  Dialog,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Menu,
  Submenu,
  MenuItem,
  Input,
  InputNumber,
  Radio,
  RadioGroup,
  RadioButton,
  Select,
  Option,
  Button,
  ButtonGroup,
  Table,
  TableColumn,
  DatePicker,
  Breadcrumb,
  BreadcrumbItem,
  Form,
  FormItem,
  Tag,
  Icon,
  Row,
  Col,
  Steps,
  Step,
  Container,
  MessageBox,
  scrollbar,
  Message,
  Checkbox,
  Loading,
  Cascader,
  Tree
} from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import router from './router'
import store from './store'

import '@/icons' // icon
import '@/permission' // permission control

import filters from './filters'

import 'babel-polyfill'

Object.keys(filters).forEach(k => Vue.filter(k, filters[k]))

Vue.prototype.$ELEMENT = { size: 'small', locale }

Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Container)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Tag)
Vue.use(Select)
Vue.use(Icon)
Vue.use(DatePicker)
Vue.use(Input)
Vue.use(InputNumber)
Vue.use(Steps)
Vue.use(Step)
Vue.use(Row)
Vue.use(Col)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(RadioButton)
Vue.use(scrollbar)
Vue.use(Dropdown)
Vue.use(DropdownItem)
Vue.use(DropdownMenu)
Vue.use(Option)
Vue.use(Cascader)
Vue.use(Checkbox)
Vue.use(Loading)
Vue.use(Tree)

// Vue.prototype.$msgbox = MessageBox
// Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
// Vue.prototype.$notify = Notification
Vue.prototype.$message = Message
Vue.prototype.$prompt = MessageBox.prompt
// Vue.use(Dropdown)
// Vue.use(DropdownMenu)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
